﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<% Response.CodePage=65001%> 
<% Response.Charset="UTF-8" %> 
<%
Response.ContentType = "text/html" 
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<%
'作者：山林客（ah_bill）
'博客：http://ruizhinet.blog.163.com
'网站：http://www.ruizhinet.cn
'本信息不会影响您网站的正常访问，请保留
checkadmin(1)
%>
<table class="table_500"  cellspacing="0" cellpadding="0">
<th>图片名称</th>
<th>图片大小</th>
<th>上传日期</th>
<th>预览</th>
<th>选择</th>
<%
dim rootuploadpath,photobox,tempdir,dirpath,objFSO,folder,filename
dim appPath
appPath=replace(LCase(Request.ServerVariables("PATH_INFO")), "admin/selectphoto_listajax.asp","" )
If Left(RZ_UPLOAD_PATH,1)="/" Then
	rootuploadpath = RZ_UPLOAD_PATH&"/"
Else
	rootuploadpath = appPath&RZ_UPLOAD_PATH&"/"
End If
photobox=HTMLEncode(request.QueryString("photobox"))
tempdir=HTMLEncode(request.QueryString("dir"))
if tempdir<>"" then
dirpath=rootuploadpath&tempdir
else
dirpath=rootuploadpath
end if
dirpath=Replace(dirpath,"//","/")
On Error Resume Next
Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
If Err.Number=-2147221005 Then 
	Response.Write "您的服务器不支持FSO，不能使用本功能"
	Err.Clear
	Response.End
End If
Set folder=objFSO.Getfolder(Server.Mappath(dirpath))
If Err.Number<>0 Then
    Response.Write ""&Err.Description&""
    Response.End
End If
Dim temp_absname
for Each filename In folder.files
temp_absname=dirpath&"/"&filename.name
temp_absname=Replace(temp_absname,"//","/")
%>
<tr class="row">
	<td><%=filename.name%></td>
	<td><%=FormatNumber(filename.size/1024,2)%>K</td>
	<td><%=filename.datecreated%></td>
	<td><span onclick="PreviewPhoto('<%=dirpath&"/"&filename.name%>')" style="cursor:pointer;">预览</span></td>
	<td><input type="button" name="sel" value="选择" onclick="CopyPhoto('<%=temp_absname%>');"/>
	</td>
</tr>
<%
  	Next
%>
</table>
<%
    Set objFSO=Nothing
    Set folder=Nothing
%>